﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;
namespace HFWebApp.user
{
    public partial class uc_AskList : BagePages
    {
        public string Titles { get; set; }
        public string PageString { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.checkAccountIsLogin();
            if (this.GetQuery("typeid") == "1")
            {
                Titles = "过期问题";
            }
            else {
                Titles = "我的问题";
            }

            if (this.GetQuery("action") != "")
            {
                int AskID = int.Parse(this.GetQuery("askid"));
                HFModel.ResultModel result = AskController.getController().doModifyAsk(AskID, 2);
                Response.Write("<script>alert('" + result.Message + "');location='/user/uc_AskList.aspx'</script>");
            }

            int PageSize = 10;
            int PageNumber = 1;
            if (this.GetQuery("Page") != "")
            {
                PageNumber = int.Parse(this.GetQuery("Page"));
            }
            int total = 0;
            string strWhere = "UserID=" + this.getLoginAccount().ID.ToString();
            Repeater1.DataSource = AskController.getController().getAskList(PageSize, PageNumber, strWhere, out total ,"ID");
            Repeater1.DataBind();
            PageString = LLL.Pager.TrunPageHtmlCode_Web(PageSize, PageNumber, total, "");
        }
    }
}